﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Mobile.Master" CodeBehind="Profile_mobile.aspx.vb" Inherits="BooksReviewApp.Profile_mobile" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
     <div data-role="content">
         
             <article data-role="content">
        <ul data-role="listview">
            
            <li>
                <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
            <ItemTemplate>
                <img src='<%# Eval("Picture") %>' alt="No Picture" width="150" height="150" />
            </ItemTemplate>
        </asp:Repeater>
                
                    <h1><asp:Label ID="lbl_UserName" runat="server" Font-Size="X-Large"></asp:Label></h1>
                    <p><asp:Label ID="lbl_RoleName" runat="server" Font-Size="Large" ForeColor="#9900FF"></asp:Label></p>
                    <p><asp:Repeater ID="Repeater8" runat="server" DataSourceID="SqlDataSource5">
            <ItemTemplate>
                Total Posts : <span id="RepeaterStyle">
                    <%# getTotalPosts(Eval("TotalPosts")) %></span>
            </ItemTemplate>
        </asp:Repeater></p>
                <p>Books Pending Verification : 
                                             <asp:HyperLink ID="hl_Pending" runat="server"  CssClass="RepeaterStyle"></asp:HyperLink></p>
            
            <p><asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlDataSource2">
            <ItemTemplate>
                Total Comments : <span id="RepeaterStyle">
                    <%# Eval("TotalComments") %></span>
            </ItemTemplate>
        </asp:Repeater></p>
            <p><asp:Repeater ID="Repeater3" runat="server" DataSourceID="SqlDataSource1">
            <ItemTemplate>
                Joined : <span id="RepeaterStyle">
                    <%# getDateFrom(Eval("DateCreated")) %></span>
            </ItemTemplate>
        </asp:Repeater></p>
                 <hr />
            <p><asp:Repeater ID="Repeater6" runat="server" DataSourceID="SqlDataSource3">
            <ItemTemplate>
                Total visits for this profile : <span id="RepeaterStyle">
                    <%# Eval("TotalViews") %></span>
            </ItemTemplate>
        </asp:Repeater></p>
                <p><asp:Repeater ID="Repeater7" runat="server" DataSourceID="SqlDataSource4">
            <ItemTemplate>
                <a id="RepeaterStyle" href="Profile.aspx?Bibliophile=<%# Eval("BibliophileVisitor") %>">
                    <%# Eval("BibliophileVisitor") %></a>
            </ItemTemplate>
        </asp:Repeater></p>
            </li>
            </ul>
            </article>
          
        <hr />
        
         <article data-role="content">
    <ul data-role="listview">
            
            <li>
                <h1>Personal Information</h1>
                <p><asp:Repeater ID="Repeater9" runat="server" DataSourceID="SqlDataSource1">
                                    <ItemTemplate>
                                        <b>Name : &nbsp;</b>
                                        <%# Eval("FirstName") %>
                                        <%# Eval("LastName") %>
                                        <br />
                                        <b>Email &nbsp;: &nbsp;</b>
                                        <%# Eval("BibliophileEmail") %>
                                        <br />
                                        <b>Age &nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;</b>
                                        <%# getAgeFrom(Eval("DateOfBirth"))%>
                                        <br />
                                        <br />
                                        <b>Date of Birth : </b>
                                        <%# getDateFrom(Eval("DateOfBirth"))%>
                                        <br />
                                        <br />
                                    </ItemTemplate>
                                </asp:Repeater></p>
            </li>
            </ul>
         </article>
           <article data-role="content">
    <ul data-role="listview">
            
            <li>
                    <h1>About me</h1>
                <p><asp:Repeater ID="Repeater5" runat="server" DataSourceID="SqlDataSource1">
                                    <ItemTemplate>
                                        <b>About me : &nbsp;</b>
                                        <%# Eval("Description") %>
                                        <br />
                                        <b>I live in : &nbsp;</b>
                                        <%# Eval("Location") %>
                                        <br />
                                    </ItemTemplate>
                                </asp:Repeater>
                                <b>I like coding with...</b>
                                <asp:Label ID="lbl_Languages" runat="server" Text="I hate languages!" Visible="True"></asp:Label>
                                <asp:Repeater ID="Repeater10" runat="server" DataSourceID="SqlDataSource8">
                                    <ItemTemplate>
                                        <span id="RepeaterStyle">
                                            <%# Eval("Language")%></span>
                                    </ItemTemplate>
                                </asp:Repeater></p>
                 </li>
            </ul>
         </article>            
                           
    
                                <h3>
                                    Personal Messages</h3>

                            
                                <div class="CommentsDetailsArea">
                                    <table>
                                        <tr>
                                            <td>
                                                Title
                                            </td>
                                            <td>
                                                <asp:TextBox ID="tb_Title" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tb_Title"
                                                    CssClass="field-validation-error" ErrorMessage="*" ValidationGroup="CommentGroup"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Message
                                            </td>
                                            <td>
                                                <asp:TextBox ID="tb_Comment" runat="server" TextMode="MultiLine" Height="75px" Width="300px"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tb_Comment"
                                                    CssClass="field-validation-error" ErrorMessage="*" ValidationGroup="CommentGroup"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                    </table>
                               
                                    <asp:Button ID="btn_Comment" runat="server" Text="Add Message" ValidationGroup="CommentGroup"
                                        CssClass="m-btn blue" CausesValidation="False" />
                                    <hr />
                                   <article data-role="content">
    <ul data-role="listview">
            
            <li>
                <div id="ContentWraperMessages">
                                                <asp:Literal ID="CommentsLtr" runat="server"></asp:Literal>
                                            </div>
            </li>
        </ul>
                                       </article>
      
                                </div>
                           
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BooksReviewDBConnectionString1 %>"
                    ProviderName="<%$ ConnectionStrings:BooksReviewDBConnectionString1.ProviderName %>" SelectCommand="SELECT * FROM [Profiles] WHERE ([Bibliophile] = @Bibliophile)">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="Bibliophile" QueryStringField="Bibliophile" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:BooksReviewDBConnectionString1 %>"
                    ProviderName="<%$ ConnectionStrings:BooksReviewDBConnectionString1.ProviderName %>" SelectCommand="SELECT * FROM [TotalCommentsPerBibliophile] WHERE ([Bibliophile] = @Bibliophile)">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="Bibliophile" QueryStringField="Bibliophile" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:BooksReviewDBConnectionString1 %>"
                    ProviderName="<%$ ConnectionStrings:BooksReviewDBConnectionString1.ProviderName %>" SelectCommand="SELECT * FROM [TotalViewsPerProfile] WHERE ([Bibliophile] = @Bibliophile)">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="Bibliophile" QueryStringField="Bibliophile" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:BooksReviewDBConnectionString1 %>"
                    ProviderName="<%$ ConnectionStrings:BooksReviewDBConnectionString1.ProviderName %>" SelectCommand="SELECT TOP 5 ID, BibliophileVisitor FROM [Profiles_Viewed] WHERE ([ProfileVisited] = @Bibliophile) ORDER BY [ID] Desc">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="Bibliophile" QueryStringField="Bibliophile" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:BooksReviewDBConnectionString1 %>"
                    ProviderName="<%$ ConnectionStrings:BooksReviewDBConnectionString1.ProviderName %>" SelectCommand="SELECT * FROM [TotalPostsPerBibliophile] WHERE ([Bibliophile] = @Bibliophile AND [IsVerified] = 1)">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="Bibliophile" QueryStringField="Bibliophile" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSource6" runat="server" ConnectionString="<%$ ConnectionStrings:BooksReviewDBConnectionString1 %>"
                    ProviderName="<%$ ConnectionStrings:BooksReviewDBConnectionString1.ProviderName %>" SelectCommand="SELECT * FROM FavoriteBook_WithName WHERE Bibliophile = @Bibliophile">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="Bibliophile" QueryStringField="Bibliophile" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                
                <asp:SqlDataSource ID="SqlDataSource8" runat="server" ConnectionString="<%$ ConnectionStrings:BooksReviewDBConnectionString1 %>"
                    ProviderName="<%$ ConnectionStrings:BooksReviewDBConnectionString1.ProviderName %>" SelectCommand="SELECT * FROM CodingLanguage_Bibliophile WHERE Bibliophile = @Bibliophile">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="Bibliophile" QueryStringField="Bibliophile" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSource7" runat="server" ConnectionString="<%$ ConnectionStrings:BooksReviewDBConnectionString1 %>"
                    ProviderName="<%$ ConnectionStrings:BooksReviewDBConnectionString1.ProviderName %>" SelectCommand="SELECT * FROM [TotalPostsPerBibliophile] WHERE ([Bibliophile] = @Bibliophile AND [IsVerified] = 0)">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="Bibliophile" QueryStringField="Bibliophile" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                
                <br style="clear: left;" />
         <article data-role="content">
             <ul data-role="listview">

                 <li>
                     <h1>Favorite Book</h1>
                     <p><asp:Label ID="lbl_NoFavBook" runat="server" CssClass="BookNameLabel" Text="Not Yet Selected"
            ForeColor="#9933FF" Font-Size="Small"></asp:Label>
        <asp:Label ID="lbl_FavBook" runat="server" Visible="False" ForeColor="Red" Font-Size="Medium"></asp:Label>
        <br />
        <asp:Repeater ID="rpt_FavBook" runat="server" Visible="False" DataSourceID="SqlDataSource6">
            <ItemTemplate>
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Book_FK", "BookDetails.aspx?ID={0}") %>'>
                        <img src='<%# Eval("Thumbnail") %>'  alt="No picture found"  width="70" height="90" style="border-style: solid; border-width: thin" />
                </asp:HyperLink>
            </ItemTemplate>
        </asp:Repeater></p>
                 </li>
             </ul>
         </article>
        
        
        <article data-role="content">
             <ul data-role="listview">

                 <li>
                     <h1>Reading Guide</h1>
                     <p><asp:Button ID="btn_Guide" runat="server" Text="View my Guide" CssClass="m-btn blue" /></p>
                 <p><asp:Button ID="btn_DeleteGuide" runat="server" Text="Delete" CssClass="m-btn red"
            OnClientClick="return confirm('Delete Guide?');" /></p>    
                 </li>
             </ul>
         </article>
       
  
    </div>
         
</asp:Content>
